package com.goldman.aplt.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @description：正则表达式
 * @author： chenxiangxiang
 * @create： 2024/2/29 17:12
 */
public class RegularUtil {
    public static boolean containsChinese(String text) {
        Pattern pattern = Pattern.compile("[\u4e00-\u9fa5]");
        Matcher matcher = pattern.matcher(text);
        return matcher.find();
    }

    public static boolean isValidAmount(String text) {
        Pattern pattern = Pattern.compile("^(\\d{1,17})(\\.\\d{1,2})?$");
        Matcher matcher = pattern.matcher(text);
        return matcher.find();
    }
}
